<template>
	<view v-if="order">
		<view class="good">
			<view>商品清单</view>
			<u-gap height="24"></u-gap>
			<view class="flex-row justify-between">
				<image :src="order.goods_pic" class="img" mode="aspectFill"></image>
				<view>
					<view class="name u-line-2">{{order.goods_name}} {{order.sku}}</view>
					<view class="name u-line-1">数量：{{order.quantity}}</view>
					<view class="name score u-line-1">{{order.total_price}}积分</view>
				</view>
			</view>
		</view>
		
		<u-gap height="24"></u-gap>
		<view class="row">
			<view>费用明细</view>
		</view>
		<view class="row">
			<view>订单单号</view>
			<view class="sub">{{no}}</view>
		</view>
		<view class="row">
			<view>商品价格</view>
			<view class="sub">{{order.total_price}}积分</view>
		</view>
		
		<u-gap height="12"></u-gap>
		<view class="row">
			<view>订单状态</view>
			<view class="sub">{{order.status_text}}</view>
		</view>
		<view class="row">
			<view>配送方式</view>
			<view class="sub">{{order.delivery_name}}</view>
		</view>
		<view class="row">
			<view>快递单号</view>
			<view class="sub">{{order.delivery_code}}</view>
		</view>
		<view class="row">
			<view>收货地址</view>
			<view class="sub-row">{{order.name+' '+order.mobile+' '+order.province+order.city+order.district+order.detail}}</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				no: '',
				order: ''
			};
		},
		onLoad(opt) {
			this.no = opt.no
			this.getData()
		},
		methods: {
			getData() {
				this.$u.get('/mall/order/detail?trade_no=' + this.no).then(res => {
					let order = res.data.result.order
					this.order = order
				})
			}
		}
	}
</script>

<style lang="scss">
	.good {
		width: 750rpx;
		height: 280rpx;
		background: rgba(255, 255, 255, 1);
		padding: 24rpx 40rpx;
		font-size: 32rpx;
		font-family: PingFangSC-Regular, PingFang SC;
		font-weight: 400;
		color: rgba(51, 51, 51, 1);
		position: relative;
	
		.img {
			width: 220rpx;
			height: 162rpx;
			object-fit: cover;
			border-radius: 8rpx;
		}
	
		.name {
			font-size: 24rpx;
			width: 420rpx;
			font-family: PingFangSC-Medium, PingFang SC;
			font-weight: 500;
			color: rgba(51, 51, 51, 1);
			line-height: 40rpx;
		}
		
		.score {
			color: rgba(255, 139, 86, 1);
		}
	}
	.row {
		width: 750rpx;
		min-height: 110rpx;
		display: flex;
		flex-wrap: wrap;
		justify-content: space-between;
		align-items: center;
		background: rgba(255, 255, 255, 1);
		padding: 32rpx 40rpx;
		font-size: 32rpx;
		font-family: PingFangSC-Regular, PingFang SC;
		font-weight: 400;
		color: rgba(51, 51, 51, 1);
		position: relative;
		
		.sub-row {
			margin-top: 16rpx;
			width: 100%;
			font-size:24rpx;
			font-family:PingFangSC-Regular,PingFang SC;
			font-weight:400;
			color:rgba(102,102,102,1);
			line-height:33rpx;
		}
	
		&::after {
			content: '';
			width: 672rpx;
			height: 2rpx;
			background: rgba(232, 232, 232, 0.6);
			position: absolute;
			bottom: 0;
			left: 50%;
			transform: translate(-50%, 0);
		}
	
		.sub {
			font-size: 28rpx;
			font-family: PingFangSC-Regular, PingFang SC;
			font-weight: 400;
			color: rgba(153, 153, 153, 1);
		}
	}
</style>
